package handin03;
import javax.swing.JFrame;
/**
 * HoroscopeFrame displays the horoscope in a JFrame
 * @author Peter Tolstrup Aagesen
 *
 */
public class HoroscopeFrame
{
	//Create the JFrame
	JFrame frame = new JFrame();
	
	//HoroscopeFrame constructor takes no arguments
	public HoroscopeFrame()
	{			
		//Setup the JFrame
		frame.setSize(400, 300);
		frame.setTitle("Horoscope");
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		
		//The JFrame is invisible until the content is ready
		frame.setVisible(false);		
	}
	
	/**
	 * showHoroscope display the horoscope in the JFrame
	 * @param signInfo String
	 * @param weekText String
	 * @param horoscopeText String
	 */
	public void showHoroscope(String signInfo, String weekText, String horoscopeText)
	{
		//Construct the component with the text
		HoroscopeTextComponent textComponent = new HoroscopeTextComponent(signInfo, weekText, horoscopeText);

		//Add component to the JFrame
		frame.add(textComponent);
		
		//Set the frame to visible
		frame.setVisible(true);	
	}

}
